home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts13-11
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: HELP 2d dynamically allocated array
- Date: Wed, 20 Mar 96 05:32:20 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4io59p$n9v@sam.inforamp.net>
- References: <4ihkae$8nt@taco.cc.ncsu.edu>
- NNTP-Posting-Host: ts34-09.tor.inforamp.net
- Keywords: help, arrays
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <4ihkae$8nt@taco.cc.ncsu.edu>,
- rbsteven@eos.ncsu.edu (Robert Barclay Stevenson) wrote:
- >
- > I am trying to figure out a way to effectively dynamically allocate a 2d
- >array using new and delete operators. I have tried using multiple
- indirection
- >on something like:
- >int **array_; //is this the same as array_[] ?
- >And then use something like:
- >array[depth] = new int[width];
- >But I think I has missed the boat somewhere along the way. If someone could
- >please point me in the right direction or send me a sample, I would be very
- >grateful. Thanks a lot.
-
- int **ai;
- ai = new int*[width];
- for (int i;i<depth;i++) ai[i] = new int;
-
- Just a suggestion. I have not compiled or debugged this.
-
-
- Agrivar
-
- aka Randy Charles Morin
- MiddleWorld SoftWare
- 1-800-363-3780
-